/*****************************************************************************//*!
* file  : systask.c
* creat : apleilx
* data  : 2017/11/05
*******************************************************************************/

#include "os_obj.h"
#include "common.h"

void os_api_tst(ULONG thread_input)
{
    ULONG msg[2];
    ULONG event;
    UINT os_err;
    
    while(1)
    {
        //wait_option , TX_NO_WAIT, TX_WAIT_FOREVER
        os_err = tx_queue_receive(&os_obj.quene_tst, 
                               msg, 
                               TX_NO_WAIT);
        
        //TX_SUCCESS
        //TX_QUEUE_EMPTY
        if(os_err == TX_SUCCESS)
        {
            dbg_print("msg received ok: %d\n",  msg[0]);
        }
        
        os_err = tx_event_flags_get(&os_obj.event_tst, 
                           0x03,
                           TX_OR_CLEAR, 
                           &event,
                           TX_NO_WAIT);
        
        if(os_err == TX_SUCCESS)
        {
            dbg_print("enent received ok: %d\n",  event);
        }
        
        osDelay(2);
    }
}

